<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <table class="table">
        <caption>用户及订单信息列表</caption>
        <thead>
        <tr>
            <th>序号</th>
            <th>用户名</th>
            <th>电话</th>
            <th>邮箱</th>
            <th>订单编号</th>
            <th>订单金额（人民币/元）</th>
            <th>订单创建日期</th>
            <th>订单到期日</th>
        </tr>
        </thead>
        <tbody id="i_content">

        </tbody>
    </table>
    <!--分页-->
    <div  style="text-align: center;margin-left: 40%;">
        <ul id="index_lm_cont_1_page"  style="margin: 0;"></ul>
    </div>



    <script>
        var searchyhddinfolink = webrootpath+"dingdan/searchyhddinfolink";


        $(function () {
            searchyhddinfo(1);
        });

        /***
         * 获取订单信息列表
         */
        function searchyhddinfo(_pagenum) {
            $.post(searchyhddinfolink,{
                pagenum:_pagenum
            },function (_info) {
                if(_info.code=="1"){
                    var datalist = _info.data;
                    var pages = _info.pages;

                    getworddatalist_pages(_pagenum,pages);
                    var htmlstr = "";
                    for(var i in datalist){
                        var dataobj = datalist[i];
                        htmlstr +="<tr>" +
                                        "<td>"+i+"</td>" +
                                        "<td>"+dataobj.username+"</td>" +
                                        "<td>"+dataobj.userphone+"</td>" +
                                        "<td>"+dataobj.useremail+"</td>" +
                                        "<td>"+dataobj.dingdanname+"</td>" +
                                        "<td>"+dataobj.dingdanjine+"</td>" +
                                        "<td>"+timestampToTime(dataobj.dingdandate)+"</td>" +
                                        "<td>"+timestampToTime(dataobj.dingdandatestop)+"</td>" +
                                  "</tr>";
                    }
                    $("#i_content").html(htmlstr);

                }

            });
        }

        /***
         * 获取分类下词表内容_分页
         */
        function getworddatalist_pages(_pagenum,_pages){
            //处理分页
            $('#index_lm_cont_1_page').bootstrapPaginator({
                currentPage: _pagenum,
                totalPages: _pages,
                size:"normal",
                bootstrapMajorVersion: 3,
                alignment:"right",
                numberOfPages:5,
                itemTexts: function (type, page, current) {
                    switch (type) {
                        case "first":
                            return "首页";
                        case "prev":
                            return "上一页";
                        case "next":
                            return "下一页";
                        case "last":
                            return "末页";
                        case "page":
                            return page;
                    }
                },
                onPageClicked: function (event, originalEvent, type, page) {
                    searchyhddinfo(page);
                }
            });
        }
        



    </script>

</body>
</html>